/*
 * ValueOT.java
 *
 * $Id: ValueOT.java,v 1.1 2008-03-18 12:58:46 mario Exp $
 */
package org.ceteca.explica.core.common;

/**
 * This class implements a generic container for storing the data
 * of a pair key-value, suitable for filling a combobox.
 * It implements the value object pattern.
 * <br/>
 * Responsibilities:
 * <ul>
 * 	<li> Store key-value pairs. </li>
 * </ul>
 * <br/>
 * @author Mario García García <mario@imagos.es>
 * Copyright (c) 2007 Fundación Centro Tecnolóxico da Carne
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <br/>
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * <br/>
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
public class ValueOT {
	/** Name of the key field of the table */
	private String keyfieldName;
	/** Name of the value field of the table */
	private String valfieldName;
	/** Key of the element */
	private long key;
	/** Value of the element */
	private String value;
	
	/**
	 * Gets the name of the internal identifier (key) field.
	 * @return String, name of the internal identifier field.
	 */
	public String getKeyfieldName() {
		return keyfieldName;
	}
	/**
	 * Sets up the name of the internal identifier field.
	 * @param keyfieldName String, name of the internal identifier field.
	 */
	public void setKeyfieldName(String keyfieldName) {
		this.keyfieldName = keyfieldName;
	}
	
	/**
	 * Gets the name of the value field.
	 * @return String, name of the value field.
	 */
	public String getValfieldName() {
		return valfieldName;
	}
	/**
	 * Sets up the name of the value field.
	 * @param valfieldName String, name of the value field.
	 */
	public void setValfieldName(String valfieldName) {
		this.valfieldName = valfieldName;
	}
	
	/**
	 * Gets the internal identifier (key) of the pair key-value.
	 * @return long, key of the element.
	 */
	public long getKey() {
		return key;
	}
	/**
	 * Sets up the internal identifier (key) of the pair key-value.
	 * @param key long, key of the element.
	 */
	public void setKey(long key) {
		this.key = key;
	}

	/**
	 * Gets the value of the pair key-value.
	 * @return String, value of the element.
	 */
	public String getValue() {
		return value;
	}
	/**
	 * Sets up the value of the pair key-value.
	 * @param value String, value of the element.
	 */
	public void setValue(String value) {
		this.value = value;
	}
	
	/**
	 * Returns tag Id assigned to CVS source file.
	 */
	public static String getRevision() {
		return "$Id: ValueOT.java,v 1.1 2008-03-18 12:58:46 mario Exp $";
	}
}
